package com.jdz.gxq.info.admin.labordisputes.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.jdz.gxq.info.admin.labordisputes.bo.Labordisputes;
import com.jdz.gxq.info.admin.labordisputes.form.EditLabordisputesForm;
import com.jdz.gxq.info.admin.labordisputes.service.LabordisputesService;
import com.jdz.gxq.info.common.action.CommonAction;

public class SaveLabordisputesAction extends CommonAction {

	private LabordisputesService labordisputesService = null;

	public ActionForward doExecute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws java.lang.Exception {

		EditLabordisputesForm editLabordisputesForm = (EditLabordisputesForm) form;

		Labordisputes labordisputes = editLabordisputesForm.getLabordisputes();

		// // labordisputes名重复验证(其他后台逻辑验证也类似处理)
		// if (!labordisputesService.checkLabordisputesName(labordisputes, 2)) {
		// ActionMessages messages = new ActionMessages();
		// messages.add("labordisputes.enterpriseName", new
		// ActionMessage("error.labordisputesNameExisted"));
		// addErrors(request, messages);
		// return mapping.getInputForward();
		// }

		labordisputes.setModifiedBy(getUserId(request));

		labordisputesService.updateLabordisputes(labordisputes);

		return mapping.findForward("success");
	}

	public void setLabordisputesService(
			LabordisputesService labordisputesService) {
		this.labordisputesService = labordisputesService;
	}
}
